//
//  SearchResultTableViewCell.m
//  StationManager
//
//  Created by 泽华伟业 on 17/3/21.
//  Copyright © 2017年 Helong. All rights reserved.
//

#import "SearchResultTableViewCell.h"

@interface SearchResultTableViewCell ()
//nameLabel
@property (nonatomic,strong) UILabel *nameLabel;
//地址
@property (nonatomic,strong) UILabel *addressLabel;

@end

@implementation SearchResultTableViewCell

- (instancetype)init
{
    self = [super init];
    if (self) {

    }
    return self;
}

- (UILabel *)nameLabel{
    if (!_nameLabel ) {
        _nameLabel = [[UILabel alloc]init];
        [self addSubview:_nameLabel];
        [_nameLabel setFont:TEXT_FONT];
        [_nameLabel setTextColor:[UIColor blackColor]];
        [_nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self);
            make.left.equalTo(self).offset(10*wl);
            make.right.equalTo(self);
            make.height.mas_equalTo(30);
        }];
    }
    return _nameLabel;
}

- (UILabel *)addressLabel{
    if (!_addressLabel) {
        _addressLabel = [[UILabel alloc]init];
        [self addSubview:_addressLabel];
        [_addressLabel setFont:[UIFont systemFontOfSize:11]];
        [_addressLabel setTextColor:[UIColor lightGrayColor]];
        [_addressLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(_nameLabel);
            make.right.equalTo(_nameLabel);
            make.top.equalTo(_nameLabel.mas_bottom);
            make.bottom.equalTo(self);
        }];
    }
    return _addressLabel;
}

//为label赋值
- (void)setTextForLabelWithName:(NSString *)name Address:(NSString *)address{
    [self.nameLabel setText:name];
    [self.addressLabel setText:address];
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
